<?php
/*
 * Index Controller
 * 
 * this file fills the template with data
 * 
 * @author : Jason Meulenhoff
 * @mail : mail@kacangboi.com
 * @web : http://kacangboi.com
 * @copyright : KacangNetworks 2010
 * 
 */

require_once ("../../config.php");
	
if(isset($_GET['action']))
{
	logout();
}
	if(isset($_SESSION['logged']))
		header("Location: home.controller.php");
	else
	{}
try
{
	if(isBreadCrumbSessionSet())
		addToList(getCurrentPage());
		
	$parser = new parser();
	$parser->loadTemplate("../templates/index.html");
	$parser->assignVar("title",PAGE_TITLE);
	
	if(DEBUG)
	{
		$parser->assignVar("debug",displayDebugMenu());
		$parser->assignVar("message",'Notice :  This Application is running in Development Mode, <span onclick="$(\'#debug\').toggle();" style=" color : orange; cursor: pointer;">Show Debug Panel</span>');
	}
	else
	{
		$parser->assignVar("debug","");
		$parser->assignVar("message","Welcome to the ViniWEB Internet Facilities Demo Portal");
	}	
	$parser->parse(true);
}catch(Exception $e)
{
	echo $e->getMessage();
}
?>